package com.hb.config;

import com.hb.impl.BraveKnight;
import com.hb.impl.SlayDragonQuest;
import com.hb.interfaces.Knight;
import com.hb.interfaces.Quest;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.io.PrintStream;

@Configuration
public class KnightConfig {
    @Bean(initMethod = "init", destroyMethod = "destroy")
    public Knight knight() {
        return new BraveKnight(quest());
    }

    @Bean
    public Quest quest() {
        return new SlayDragonQuest(System.out);
    }

    @Bean
    public PrintStream printStream() {
        return System.out;
    }
}
